home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / clip2iff30.rexx < prev    next >
OS/2 REXX Batch file  |  1996-04-23  |  3KB  |  98 lines

  1. /* Clip2IFF30.rexx V2.0 -- Export a clip as IIF Files */
  2. /* By Bob Caron © 1995 NewTek Inc.                    */
  3.  
  4. parse arg InClipName","OutClipName","StartFrame","EndFrame
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. IFFBaseName=OutClipName
  11. if endframe="" then do
  12.  'Askb'"Please select;A source clip."
  13.  exit
  14.  end
  15.  
  16. if ~show('l','rexxsupport.library') then do
  17.   if ~addlib('rexxsupport.library',0,-30,34) then do
  18.     exit
  19.   end
  20. end
  21.  
  22. dots=0
  23. XWin = 100
  24. YWin = 40
  25. Clear = d2c(12)
  26. nv = ''
  27. cr = '0a'x
  28. call getfontsize
  29.  
  30. wid = width*48
  31. hei = theight+height*10
  32.  
  33. if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/Clip2IFF30 Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  34.     exit
  35. end
  36.  
  37. if inclipname="" then do
  38.   'Askb'"You need a;Source Clip!"
  39.   exit
  40.   end
  41.  
  42.  i=0
  43.  endframe=StartFrame+((EndFrame-StartFrame)/2)
  44.  OutName=IFFBaseName||"."||i
  45.  do i = StartFrame to EndFrame
  46.         call OpenWindow(InclipName,OutName,i,EndFrame,i)
  47.         'Gnfd'                                                  /* Get Field and inc */
  48.         'Snfd'                                                  /* Skip 2nd field in frame */
  49.         OutName=IFFBaseName||"."||i       /* Setup save name */
  50.         call OpenWindow(InclipName,OutName,i,EndFrame,i)
  51.         'Asav'OutName                                           /* Write out RGB */
  52.  end
  53. exit
  54.  
  55. OpenWindow:
  56. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  57.   pdots="...."
  58.   dots=dots+1
  59.   if dots>4 then dots=1
  60.   call writech('Window',Clear||nv||cr)
  61.   call writech('Window','Current Source Clip ['InClipName']'cr)
  62.   call writech('Window','  Current Dest IFF  ['OutClipName']'cr)
  63.   call writech('Window',''cr)
  64.   call writech('Window','Current Field: 'Frame''cr)
  65.   call writech('Window','    End Field: 'EndFrame''cr)
  66.   call writech('Window',''cr)
  67.   call writech('Window','Processing'right(pdots,dots)||cr)
  68.  
  69. return
  70.  
  71.  
  72. getfontsize:
  73.  
  74. if open('font','env:sys/font.prefs','R') then do
  75.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  76.    call close('font')
  77.    font = substr(font,index(font,'FONT')+4)
  78.    font = substr(font,index(font,'FONT')+4)
  79.    height = c2d(substr(font,29,2))
  80.    tfont = substr(font,index(font,'FONT')+4)
  81.    theight = c2d(substr(tfont,29,2))
  82.    font = substr(font,33)
  83.    font = left(font,index(font,d2c(0))-1-5)
  84.    if open('font','FONTS:'font'/'height,'R') then do
  85.       width = c2d(right(readch('font',116),2))
  86.       call close('font')
  87.   end
  88.   else if height=9 then width = 10
  89.                    else width = 8
  90. end
  91.   else do
  92.   theight = 8
  93.   height = 8
  94.   width = 8
  95. end
  96.  
  97. return
  98.